package com.htfyun;

import android.os.Environment;

import com.htfyun.database.PngName;

import java.io.File;

/**
 * Created by sst on 2017/12/4.
 */

public final class Constants {

    public static final int COVER_HEIGHT = 180;
    public static final int COVER_WIDTH = COVER_HEIGHT * 2 / 3;
    
    public static final int COVER_HEIGHT_ITEM = COVER_HEIGHT;//65;
    public static final int COVER_WIDTH_ITEM = COVER_HEIGHT_ITEM * 2 / 3;

    private static final String MYBOOKS_PATH = Environment.getExternalStorageDirectory().toString() + "/myBooks/";
    private static final String MYPICTURES_PATH = Environment.getExternalStorageDirectory().toString() + "/myPictures/";

    private static final String PNG_PATH = Environment.getExternalStorageDirectory().toString() + "/.pngPath/";

    public static final String getPngPath() {
        File file = new File(PNG_PATH);
        if (!file.exists()) {
            file.mkdirs();
        }

        return file.getPath();
    }

    public static final String getMyBooksPath() {
        File file = new File(MYBOOKS_PATH);
        if (!file.exists()) {
            file.mkdirs();
        }

        return file.getPath();
    }

    public static final String getMyPicturesPath() {
        File file = new File(MYPICTURES_PATH);
        if (!file.exists()) {
            file.mkdirs();
        }

        return file.getPath();
    }
    
    public static final String toPngPath(String pngName) {
        return getPngPath() + File.separator + pngName;
    }
    
    public static final String CURRENT_IMAGE_POSITION = "currentImagePosition";

    public static final String ACTION_SAVE_BMP = "action.pw.save_bmp";
}
